//
//  WorkDetailViewController.m
//  MarkManager
//
//  Created by SZJ on 2020/4/7.
//  Copyright © 2020 SZJ. All rights reserved.
//

#import "WorkDetailViewController.h"

@interface WorkDetailViewController ()

@end

@implementation WorkDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _qlpreviewController = [[QLPreviewController alloc] init];
    _qlpreviewController.dataSource = self;
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = self.n_title;
  
}

-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [self addChildViewController:self.qlpreviewController];
      self.qlpreviewController.view.frame = self.view.bounds;
    self.qlpreviewController.view.backgroundColor = [UIColor whiteColor];
      [self.view addSubview:self.qlpreviewController.view];
}
#pragma mark - qlpreViewdataSource

-(NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller{
    return 1;
}

-(id<QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index{
    NSURL *url = [NSURL fileURLWithPath:self.filePath];
    return url;
}


@end
